import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        name: '',
        level: '',
        menuList1: [
            {
                "id": 100, "path": "/admin",

                "sList":
                    [{ "id": 101, "path": "/user", "title": "用户列表" }],
                "title": "权限管理"
            },
            {
                "id": 600, "path": "/money",

                "sList":
                    [{ "id": 601, "path": "/cost", "title": "费用查询" }],
                "title": "计费管理"
            },
        ],
        menuList2: [
            {
                "id": 100, "path": "/admin",

                "sList":
                    [{ "id": 101, "path": "/user", "title": "用户列表" }],
                "title": "权限管理"

            },
            {
                "id": 700, "path": "/groupt",

                "sList":
                    [{ "id": 701, "path": "/groupt", "title": "群组管理" }],
                "title": "群组管理"

            },
            {
                "id": 800, "path": "/questionnairet",

                "sList":
                    [{ "id": 801, "path": "/questionnairet", "title": "问卷设置" }],
                "title": "问卷管理"
            },

        ],
        menuList3: [
            {
                "id": 200, "path": "/questionnaire",

                "sList":
                    [{ "id": 201, "path": "/sendq", "title": "发布问卷" },
                    { "id": 202, "path": "/template", "title": "模板管理" },
                    { "id": 203, "path": "/garbage", "title": "回收站" },],
                "title": "问卷管理"
            },
            {
                "id": 300, "path": "/groups",

                "sList":
                    [{ "id": 301, "path": "/groups", "title": "群组管理" }],

                "title": "群组管理"
            },
            {
                "id": 400, "path": "/answer",

                "sList":
                    [{ "id": 401, "path": "/answered", "title": "已答问卷" },
                    { "id": 402, "path": "/unanswered", "title": "未答问卷" },
                    ],
                "title": "我的答卷"
            },
            {
                "id": 500, "path": "/analyse",

                "sList":
                    [{ "id": 501, "path": "/screen", "title": "数据大屏" },
                    ],
                "title": "数据分析"
            }],
        menuList4: [{
            "id": 400, "path": "/answer",

            "sList":
                [{ "id": 401, "path": "/answered", "title": "已答问卷" },
                { "id": 402, "path": "/unanswered", "title": "未答问卷" },
                ],
            "title": "我的答卷"
        }]

    },
    mutations: {
        saveinfor(state, data) {
            state.name = data.name,
            state.level = data.level
        },
        clearinfor(state) {
            state.name = '';
            state.level = ''
        }
    }
})
export default store